class BooksBean{
  //书名
  final String bookName;

  //图书地址
  final String bookUrl;
  //作者
  final String author;

  //最新章节url
  final String lastUrl;

  //最新章节标题
  final String lastTitle;

  //文章类型
  final String type;

  //图书封面
  final String bookCover;

  BooksBean(this.bookName, this.bookUrl, this.author, this.lastUrl,
      this.lastTitle, this.type, this.bookCover);

  @override
  String toString() {
    return 'BooksBean{bookName: $bookName, bookUrl: $bookUrl, author: $author, lastUrl: $lastUrl, lastTitle: $lastTitle, type: $type, bookCover: $bookCover}';
  }
}

class BookTypeBean{
  final String typeName;
  final String typeUrl;

  BookTypeBean(this.typeName, this.typeUrl);

  @override
  String toString() {
    return 'BookTypeBean{typeName: $typeName}';
  }
}

class BooksTypeListBean{
  //书名
  final String bookName;

  //图书地址
  final String bookUrl;
  //作者
  final String author;

  //最新章节url
  final String lastUrl;

  //最新章节标题
  final String lastTitle;

  //文章类型
  final String type;

  //图书封面
  final String bookCover;

  //图书简介
  final String bookIntro;

  BooksTypeListBean(this.bookName, this.bookUrl, this.author, this.lastUrl,
      this.lastTitle, this.type, this.bookCover,this.bookIntro);

  @override
  String toString() {
    return 'BooksBean{bookName: $bookName, bookUrl: $bookUrl, author: $author, lastUrl: $lastUrl, lastTitle: $lastTitle, type: $type, bookCover: $bookCover}';
  }
}

class BookDetailBean{
  String bookName;
  String bookId;
  String lastName;
  String lastLink;
  String author;
  String bookCover;
  String bookIntro;
  List<BookChapter> bookChapter;

  BookDetailBean({this.bookName, this.bookId, this.lastName, this.lastLink,
      this.author, this.bookCover, this.bookIntro, this.bookChapter});
  BookDetailBean.fromJson(Map<String, dynamic> json) {
    bookName = json['bookName'];
    bookId = json['bookId'];
    lastName = json['lastName'];
    lastLink = json['lastLink'];
    author = json['author'];
    bookCover = json['bookCover'];
    bookIntro = json['bookIntro'];
    if (json['bookChapter'] != null) {
      bookChapter = new List<BookChapter>();
      json['bookChapter'].forEach((v) {
        bookChapter.add(new BookChapter.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bookName'] = this.bookName;
    data['bookId'] = this.bookId;
    data['lastName'] = this.lastName;
    data['lastLink'] = this.lastLink;
    data['author'] = this.author;
    data['bookCover'] = this.bookCover;
    data['bookIntro'] = this.bookIntro;
    if (this.bookChapter != null) {
      data['bookChapter'] = this.bookChapter.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
class BookChapter{
  String chapterName;
  String chapterLink;

  BookChapter(this.chapterName, this.chapterLink);
  BookChapter.fromJson(Map<String, dynamic> json) {
    chapterName = json['chapterName'];
    chapterLink = json['chapterLink'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['chapterName'] = this.chapterName;
    data['chapterLink'] = this.chapterLink;
    return data;
  }
}

class BookFavoriteBean{
  String bookName;
  String bookId;
  String bookUrl;
  String bookCover;
  String readingChapter;
  String readingChapterName;
  List<BookChapter> chapterList;
  //_ReadBookState(this.chapterName, this.chapterUrl,this.bookId,this.totalChapter,this.chapterList);
  BookFavoriteBean(this.bookName, this.bookId, this.bookUrl, this.bookCover,this.readingChapter,this.readingChapterName,this.chapterList);
  BookFavoriteBean.fromJson(Map<String, dynamic> json) {
    bookName = json['bookName'];
    bookId = json['bookId'];
    bookUrl = json['bookUrl'];
    bookCover = json['bookCover'];
    readingChapter = json['readingChapter'];
    readingChapterName = json['readingChapterName'];
    if (json['chapterList'] != null) {
      chapterList = new List<BookChapter>();
      json['chapterList'].forEach((v) {
        chapterList.add(new BookChapter.fromJson(v));
      });
    }
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bookName'] = this.bookName;
    data['bookId'] = this.bookId;
    data['bookUrl'] = this.bookUrl;
    data['bookCover'] = this.bookCover;
    data['readingChapter'] = this.readingChapter;
    data['readingChapterName'] = this.readingChapterName;
    if (this.chapterList != null) {
      data['chapterList'] = this.chapterList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class DBHelpFavoriteBean{
  String book_name;
  String book_url;
  String book_cover;
  String book_detail_bean;
  String reading_chapter;
  DBHelpFavoriteBean({this.book_name, this.book_url,
      this.book_cover, this.book_detail_bean, this.reading_chapter});
  factory DBHelpFavoriteBean.fromMap(Map<String,dynamic> json) => DBHelpFavoriteBean(
      book_name:json['book_name'],
      book_url:json['book_url'],
      book_cover:json['book_cover'],
      book_detail_bean:json['book_detail_bean'],
      reading_chapter:json['reading_chapter'],
  );
  Map<String, dynamic> toMap()=>{
    "book_name":book_name,
    "book_url":book_url,
    "book_cover":book_cover,
    "book_detail_bean":book_detail_bean,
    "reading_chapter":reading_chapter,
  };
}